<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <title><%= @title || '40 website blog' %></title>
  <script type="text/javascript" src="/javascripts/Base.js"></script>
  <script language=javascript src="/javascripts/date.format.js" type="text/javascript"></script>
  <%= javascript_include_tag :defaults %>
  <%= yield :head%>
  <link rel="stylesheet" type="text/css" href="/jointStyle/css/layout.css">
  <style type="text/css">
  <!--
  .STYLE1 {
	color: #CCCCCC;
	font-weight: bold;
  }
  .STYLE2 {color: #FFFFFF}
  -->
  </style>

  <!--[if lt IE 7.]>
    <script defer type="text/javascript" src="/javascripts/pngfix.js"></script>
    <![endif]-->
    
 <SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {

var now = new Date();
var monthnumber = now.getMonth();
var monthday    = now.getDate();
var year        = now.getFullYear();

monthnumber = monthnumber + 1;
var dateValue = ""+year
dateValue+=((monthnumber < 10) ? "-0" : "-") + monthnumber
dateValue+=((monthday < 10) ? "-0" : "-") + monthday

var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = "" + hours

timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds

document.getElementById('face').innerHTML= dateValue+" "+timeValue;

timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
// End -->
</SCRIPT>    
</head>

<body  onLoad="startclock()">
<table id="Header" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" valign="middle" class="topbar">&nbsp;<img src="/jointStyle/img/Mark_arrow.jpg" alt="timemark" width="10" height="10" /><span class="Ft_blue Ft_Smaller"  id="face"> </span> <span class="Ft_Smaller"><%= Article.count(:all,:conditions=>["created_at>:created_at and published=1",{:created_at=>24.hours.ago}]) %> POSTS IN The LAST 24 HR-<a href="/tooltips" class="GrayUnderline">Tool Tip</a></span> <span class="Ft_Smaller"><a href="/index.xml" class="PinkUnderline"><image src=/images/small_feed_icon.png></image> </a></span></td>
  </tr>
  <tr>
    <td align="right" valign="bottom" class="TopPic">
    <% unless logged_in? %>
      <% form_remote_tag :url => rlogin_session_path, :method => :post do -%>
    <table id="LoginBox" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" class="usename Ft_Smallest Ft_lightGray">&nbsp;UserName:</td>

        <td align="left" valign="bottom" class="password Ft_Smallest Ft_lightGray">&nbsp;Password:</td>
        <td class="Submit"></td>
      </tr>
      <tr>
        <td align="center" class="usename"><%= text_field_tag 'email', params[:email],
                                  :maxlength => Person::MAX_EMAIL,:class=>"inputName"  %></td>
        <td align="center" class="password">
         <%= password_field_tag 'password', params[:password],
                                         :maxlength => Person::MAX_PASSWORD,:class=>"inputPassword" %>
        </td>
        <td align="center" valign="middle" class="Submit"><%= submit_tag '', :class => "btn_Login" %></td>
      </tr>
      <tr>
        <td colspan="3" align="left" valign="bottom">&nbsp;<%= link_to 'Sign up', cat_signup_path(@cat_id),{:class=>'white'} %> <span class="Ft_pink Ft_Smallest">|</span><a href="#" class="white"> Forget password</a> <span class="Ft_pink Ft_Smallest">| </span><a href="#" class="white">Help</a> </td>
        </tr>
    </table>
    <% end -%>
	<% else %>
		<div > 
		 <strong>Welcome, <%= link_to( current_person.name, cat_person_path(@cat_id,current_person) ) %></strong> <span style="color: #E81F8F; font-weight: bold;">| </span><%= link_to_remote 'Sign out', :url =>cat_logout_path(@cat_id) %> <span style="color: #E81E8E; font-weight: bold;">|
		                <%- if current_person.admin? -%>
                <%- if admin_view? -%>
                  <%= link_to("Profile", cat_person_path(@cat_id,current_person) ) %>
                <%- else -%>
                  <%= link_to("Admin", admin_preferences_path) %>
                <%- end -%>
             <%- else -%>
                  <%= link_to("Profile", cat_person_path(@cat_id,current_person)) %>
              <%- end -%>
		</div>
	<% end %>
    </td>
    <td rowspan="4" align="left" valign="bottom"><a href="#"><img src="/images/Ad/AD1300-250.jpg" alt="ad1" width="300" height="250" border="0" /></a></td>
<!--    <td rowspan="4" align="left" valign="bottom" class="rightAD" id="rightad">zz<a href="#"><img src="/images/Ad/AD1300-250.jpg" alt="ad1" width="300" height="250" border="0" /></a></td>
-->
  </tr>
  <tr>
    <td align="left" id="Nav"><div id=categories style='width:699px;overflow:hidden'>
    <%= render :partial => 'layouts/categories' %>
    </div></td>
  </tr>
  <tr>
    <td align="left" ><div id=category_items style='width:699px;overflow:hidden'>
     <%= render :partial => 'layouts/category_items' %>
    </div></td>
  </tr>

  <tr>
    <td class="ImgInfo" >&nbsp;&nbsp;<a id="imgName" href="#" class="blue italic smaller"></a>&nbsp;<a id="imgNote" href="#" class="lightGray italic smaller "></a></td>
  </tr>
</table>
<table width="1012" border="0" cellpadding="0" cellspacing="0" id="ContentBox">
  <tr>
    <td align="center" valign="top"  class="leftBar">
    <%form_tag(:controller=>'home',:action=>'searchres',:searcht=>'searcres') do%>
    <table width="100%" border="0" cellspacing="0" cellpadding="6">
      <tr>
        <td align="center" ><input name="textfield2" type="text" class="SearchInput" id="textfield2" value='<%=session[:secondi]%>' /></td>
      </tr>

      <tr>
        <td height="25" align="center"><input name="button" type="submit" class="Btn_Search" value="" /></td>
      </tr>
    </table>
    <%end%>
    <a href="#"><img src="/images/Ad/Ad600-120.jpg" alt="ad2" name="Advertisement600_120" width="128" height="608" border="0"  class="Advertisementleft" /></a></td>
    <td width="868" align="left" valign="top" class="rightBox">
    <% unless (@not_show_toolbar) or @show_person.nil? %>
   <%= link_to "Profile",  cat_person_path(@cat_id,@show_person) %> |
   <%= link_to "People",   cat_people_path(@cat_id) %>  |
   <%= link_to "Articles", blogs_cat_person_path(@cat_id,@show_person) %> |
   <%= link_to "New article", new_cat_blog_path(@cat_id) if current_person?(@show_person) %> |
   <%= link_to "Messages", messages_path %> |
   <%= link_to "Friends", friends_cat_person_path(@cat_id,@show_person)  %> |
   <%= link_to "Followers", followers_cat_person_path(@cat_id,@show_person)  %> |
   <%= link_to "Activities", events_cat_person_path(@cat_id,@show_person)  %> |
   <%= link_to "Home",   cat_home_path(@cat_id) %>
   <% end %>
   	<%= yield %>
       <table id="footer" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;&nbsp;&nbsp;<a href="#" class="Gray">Terms and conditions</a> - <a href="#" class="Gray">contact us</a> <span class="STYLE1">|</span> copyright 40 website ltd </td>
      </tr>
    </table></td>

  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="27">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
